#include "courier.h"
#include <nds.h>

using namespace WoopsiUI;

static const u16 Courier_glyphdata[211] = {
/* '!' */	0xF400,
/* '"' */	0xB400,0x0000,
/* '#' */	0x2ABE,0xAFAA,0x8000,
/* '$' */	0x4F33,0x9000,
/* '%' */	0x443C,0x2200,
/* '&' */	0x074C,0xAF00,
/* ''' */	0xE000,
/* '(' */	0x6AA4,
/* ')' */	0x9558,
/* '*' */	0x5D50,0x0000,
/* '+' */	0x0109,0xF210,0x0000,
/* ',' */	0x0068,
/* '-' */	0x0070,0x0000,
/* '.' */	0x0400,
/* '/' */	0x1222,0x4480,
/* '0' */	0x56DA,0x8000,
/* '1' */	0x6108,0x427C,0x0000,
/* '2' */	0x5529,0xC000,
/* '3' */	0x54A3,0x8000,
/* '4' */	0x26AF,0x2700,
/* '5' */	0xF31A,0x8000,
/* '6' */	0x735B,0x8000,
/* '7' */	0xF4A4,0x8000,
/* '8' */	0x555A,0x8000,
/* '9' */	0x76B3,0x8000,
/* ':' */	0x2400,
/* ';' */	0x0460,
/* '<' */	0x012C,0x2100,
/* '=' */	0x1C70,0x0000,
/* '>' */	0x0843,0x4800,
/* '?' */	0x54A0,0x8000,
/* '@' */	0x699B,0x9870,
/* 'A' */	0x6114,0xE8EC,0x0000,
/* 'B' */	0xF25C,0x94F8,0x0000,
/* 'C' */	0xF648,0xC000,
/* 'D' */	0xF252,0x94F8,0x0000,
/* 'E' */	0xFA58,0x84FC,0x0000,
/* 'F' */	0xFA58,0x8470,0x0000,
/* 'G' */	0xE88B,0xA600,
/* 'H' */	0xEA5E,0x94F4,0x0000,
/* 'I' */	0xE925,0xC000,
/* 'J' */	0x722A,0xA400,
/* 'K' */	0xDA98,0xE56C,0x0000,
/* 'L' */	0xE210,0x84FC,0x0000,
/* 'M' */	0xDEF7,0x58EC,0x0000,
/* 'N' */	0xDB5A,0xB5F4,0x0000,
/* 'O' */	0x6999,0x9600,
/* 'P' */	0xF252,0xE470,0x0000,
/* 'Q' */	0x6999,0x9630,
/* 'R' */	0xF252,0xE4F4,0x0000,
/* 'S' */	0xF51B,0xC000,
/* 'T' */	0xFD48,0x4238,0x0000,
/* 'U' */	0xDA52,0x9498,0x0000,
/* 'V' */	0xDC52,0xA518,0x0000,
/* 'W' */	0xDC6B,0x5AA8,0x0000,
/* 'X' */	0xDA88,0x456C,0x0000,
/* 'Y' */	0xDC54,0x4238,0x0000,
/* 'Z' */	0xF924,0x9F00,
/* '[' */	0xEAAC,
/* '\' */	0x8442,0x2210,
/* ']' */	0xD55C,
/* '^' */	0x4A80,0x0000,
/* '_' */	0x0000,0x0003,0xE000,
/* '`' */	0x9000,
/* 'a' */	0x0062,0xEF00,
/* 'b' */	0xC21C,0x94F8,0x0000,
/* 'c' */	0x03C9,0xC000,
/* 'd' */	0x3179,0x9700,
/* 'e' */	0x03F8,0xC000,
/* 'f' */	0x2BA5,0xC000,
/* 'g' */	0x0799,0x7160,
/* 'h' */	0xC21C,0x94F4,0x0000,
/* 'i' */	0x4325,0xC000,
/* 'j' */	0x4392,0x4F00,
/* 'k' */	0xC216,0xE56C,0x0000,
/* 'l' */	0xC925,0xC000,
/* 'm' */	0x0035,0x5AD4,0x0000,
/* 'n' */	0x003C,0x94E4,0x0000,
/* 'o' */	0x0069,0x9600,
/* 'p' */	0x0792,0x9723,0x8000,
/* 'q' */	0x0799,0x7130,
/* 'r' */	0x00F4,0x4E00,
/* 's' */	0x01A3,0x8000,
/* 't' */	0x023C,0x8498,0x0000,
/* 'u' */	0x0036,0x949C,0x0000,
/* 'v' */	0x0032,0x9318,0x0000,
/* 'w' */	0x0037,0x5AA8,0x0000,
/* 'x' */	0x0096,0x6900,
/* 'y' */	0x06D4,0xA211,0x8000,
/* 'z' */	0x00FA,0x5F00,
/* '{' */	0x2964,0x8800,
/* '|' */	0xFE00,
/* '}' */	0x8934,0xA000,
/* '~' */	0x0005,0xA000,
/* 0x7F */	0x0F99,0x99F0,
};

static const u16 Courier_offset[95] = {
    0,    1,    3,    6,    8,   10,   12,   13,   14,   15,   17,   20,   21,   23,   24,   26,
   28,   31,   33,   35,   37,   39,   41,   43,   45,   47,   48,   49,   51,   53,   55,   57,
   59,   62,   65,   67,   70,   73,   76,   78,   81,   83,   85,   88,   91,   94,   97,   99,
  102,  104,  107,  109,  112,  115,  118,  121,  124,  127,  129,  130,  132,  133,  135,  138,
  139,  141,  144,  146,  148,  150,  152,  154,  157,  159,  161,  164,  166,  169,  172,  174,
  177,  179,  181,  183,  186,  189,  192,  195,  197,  200,  202,  204,  205,  207,  209
};

static const u8 Courier_width[95] = {
 1, 3, 5, 3, 4, 4, 1, 2, 2, 3, 5, 2, 3, 1, 4, 3,
 5, 3, 3, 4, 3, 3, 3, 3, 3, 1, 2, 4, 3, 4, 3, 4,
 5, 5, 3, 5, 5, 5, 4, 5, 3, 4, 5, 5, 5, 5, 4, 5,
 4, 5, 3, 5, 5, 5, 5, 5, 5, 4, 2, 4, 2, 3, 5, 2,
 4, 5, 3, 4, 3, 3, 4, 5, 3, 3, 5, 3, 5, 5, 4, 5,
 4, 4, 3, 5, 5, 5, 5, 4, 5, 4, 3, 1, 3, 4, 4
};

Courier::Courier(u8 fixedWidth) : PackedFont1 (
	33,
	127,
	Courier_glyphdata,
	Courier_offset,
	Courier_width,
	8,
	2,
	5,
	5
) {
	if (fixedWidth) setFontWidth(fixedWidth);
};
